<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="app">
        <h1>{{person.name}}的生命周期练习</h1>
        <h1>num ==> {{num}}</h1>
        <button @click="num++">点击这里将num++</button>
    </div>
    
</body>

<script src="./js/vue.js"></script>
<script>
    const vm = new Vue({
        el: "#app",
        data: {
            num: 0,
            person: {
                name: '张三',
                age: 18
            }
        },
        methods: {
            f1() {
                console.log("这里调用f1方法");
            }
        },
        beforeMount() {
            console.log("此时的页面没有渲染完成");
            debugger
        },
        mounted() {
            console.log("页面渲染完成，调用mounted钩子");
            debugger
        },
        beforeUpdate() {
            console.log("点击按钮，在页面更新渲染前调用钩子");
            debugger
        },
        updated() {
            console.log("点击按钮，在页面更新渲染后调用钩子");
            debugger
        },
        destroyed() {
            
        },
    })

</script>
</html>